/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package coalescent.nb.jobs.properties;

import coalescent.cef.pui.CheckPhylogenyEventImpl;
import coalescent.cef.pui.RunBackwardRecursionEventImpl;
import coalescent.cef.pui.VisualizeGeneTreeEventImpl;
import commons.nb.jobs.properties.ComboProperty;
import commons.nb.jobs.properties.ComboPropertyImpl;
import commons.nb.jobs.properties.Property;
import commons.nb.jobs.properties.Propertys;

/**
 * Creates a builder from one or more properties.
 *
 * @author Susanta Tewari
 * @version 2.0.0
 * @history Created on April 15, 2011
 * @since 1.0.0
 */
public class CoalescentComboPropertys {

    /**
     * Private constructor to prevent instantiation.
     */
    private CoalescentComboPropertys() {}

    /**
     * Supplies the following properties in {@link RunBackwardRecursionEventImpl}. The properties are:
     * <ul>
     * <li>{@code coalescent.builder.StringKC64Data.theta = valid double string as specified in } {@link Double#parseDouble(java.lang.String)}</li>
     * <li>{@code coalescent.builder.StringKC64Data.cnForm = valid values are of the format f1^t1_f2^t2... where fi and ti are positive and represent the frequency domain, and the alleles on that frequency domain, respectively}</li>
     * </ul>
     *
     * @return a new instance of the builder property
     */
    public static ComboProperty StringKC64Data_Recursion() {


        // property theta
        final Property THETA = CoalescentPropertys.THETA();

        THETA.setKey("coalescent.builder.StringKC64DataRecursion.theta");


        // property kc64 data
        final Property KC64_DATA = CoalescentPropertys.KC64_DATA();

        KC64_DATA.setKey("coalescent.builder.StringKC64DataRecursion.theta");

        return new ComboPropertyImpl(THETA, KC64_DATA);
    }

    /**
     * Supplies the following properties in {@link RunBackwardRecursionEventImpl}. The properties are:
     * <ul>
     * <li>{@code coalescent.builder.GTRecursion.theta = valid double string as specified in } {@link Double#parseDouble(java.lang.String)}</li>
     * <li>{@code coalescent.builder.GTRecursion.url = stringk69data:xml//URL}<a href="coalescent/cef/pui/pob/doc-files/k69data.xml.txt">file format</a>, must accompany the<a href="coalescent/cef/pui/pob/doc-files/k69data.xsd.txt">schema</a></li>
     * </ul>
     *
     * @return a new instance of the builder property
     */
    public static ComboProperty FBasedGT_Recursion() {


        // property theta
        final Property THETA = CoalescentPropertys.THETA();

        THETA.setKey("coalescent.builder.GTRecursion.theta");


        // property k69 data
        final Property K69_DATA_URL = CoalescentPropertys.K69_DATA_URL();

        K69_DATA_URL.setKey("coalescent.builder.GTRecursion.url");

        return new ComboPropertyImpl(THETA, K69_DATA_URL);
    }

    /**
     * Supplies the following properties in {@link VisualizeGeneTreeEventImpl}. The properties are:
     * <ul>
     * <li>{@code coalescent.builder.GeneTree.theta = valid double string as specified in } {@link Double#parseDouble(java.lang.String)}</li>
     * <li>{@code coalescent.builder.GeneTree.url = stringk69data:xml//URL}<a href="coalescent/cef/pui/pob/doc-files/k69data.xml.txt">file format</a>, must accompany the <a href="coalescent/cef/pui/pob/doc-files/k69data.xsd.txt">schema</a></li>
     * </ul>
     *
     * @return a new instance of the builder property
     */
    public static ComboProperty FileBasedGeneTree() {


        // property theta
        final Property THETA = CoalescentPropertys.THETA();

        THETA.setKey("coalescent.builder.GeneTree.theta");


        // property k69 data
        final Property K69_DATA_URL = CoalescentPropertys.K69_DATA_URL();

        K69_DATA_URL.setKey("coalescent.builder.GeneTree.url");

        return new ComboPropertyImpl(THETA, K69_DATA_URL);
    }

    /**
     * Supplies the following properties in {@link CheckPhylogenyEventImpl}. The properties are:
     * <ul>
     * <li>{@code coalescent.builder.CheckPPhylogenyAlgo.algorithm}("GUSFIELD", "FOURGAMETES")</li>
     * </ul>
     *
     * @return a new instance of the builder property
     */
    public static ComboProperty PHYLOGENY_ALGO() {
        return new ComboPropertyImpl(CoalescentPropertys.PHYLOGENY_ALGO());
    }

    /**
     * Supplies the following properties in {@link RunBackwardRecursionEventImpl}. The properties are:
     * <ul>
     * <li>{@code coalescent.builder.BRComputations.exactProb = true | false}</li>
     * <li>{@code coalescent.builder.BRComputations.configCounter = true | false}</li>
     * <li>{@code coalescent.builder.BRComputations.genealogyCounter = true | false}</li>
     * <li>{@code coalescent.builder.BRComputations.configBuilder = true | false}</li>
     * <li>{@code coalescent.builder.BRComputations.genealogyBuilder = true | false}</li>
     * </ul>
     *
     * @return a new instance of the builder property
     */
    public static ComboPropertyImpl RECURSION_COMPUTATIONS() {

        return new ComboPropertyImpl(CoalescentPropertys.RECURSION_COMPUTATION_EXACT_PROB(),
                                     CoalescentPropertys.RECURSION_COMPUTATION_CONFIG_COUNT(),
                                     CoalescentPropertys.RECURSION_COMPUTATION_GENEALOGY_COUNT(),
                                     CoalescentPropertys.RECURSION_COMPUTATION_CONFIG_BUILDER(),
                                     CoalescentPropertys.RECURSION_COMPUTATION_GENEALOGY_BUILDER());
    }

    /**
     * Collects information for recursion cache exe listener {@code VisualizeRecursionCacheDistn}.
     *
     * @return a new instance of the property
     */
    public static Property<Boolean> RECURSION_PROFILE_CACHE_DISTN_PROP() {

        return Propertys.ofBoolean("recursion-profile", "profile recursion cache?",
                                   "Profile the recursion cache distribution",
                                   CoalescentPropertySets.PROFILE, "", false);
    }
}
